from matplotlib.pyplot import plot as plt
import torch 

def debug_data(data):
    if torch.is_tensor(data):
        if data.device.type == 'cuda':
            data = data.cpu().detach().numpy()
        if data.device.type == 'cpu':
            data = data.detach().numpy()
    else:
        data = data
    plt.plot(data)
    plt.show()

    